<%@page import="util.GlobalParams"%>
<%@page import="models.MatchUser"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%
	String userName = "";
	if(request.getSession().getAttribute("loginUser")==null){
		response.sendRedirect("login.html");
	} else {
		userName = ((MatchUser)(request.getSession().getAttribute("loginUser"))).getUserName();
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<title>积分榜</title>
<link type="text/css" href="css/css.css" rel="stylesheet" />
<script type='text/javascript' src="dwr/engine.js"></script>
<script type='text/javascript' src="dwr/util.js"></script>
<script type='text/javascript' src="dwr/interface/DataHelper.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" >
	var PARAMS = { "data": {}, "user":""};
	$(document).ready(function(){
		PARAMS.user = "<%= userName %>";
		getScoreList();
	});
	
	getScoreList = function(){
		DataHelper.getScoreList(function(result){
			if (!result.isTrue) {
				alert(result.message);
			}
			else {
				$("#score_list").empty();
				var html ="";
				for(var i=0; i<result.tag.length; i++){
					var obj = result.tag[i];
					PARAMS.data[obj.key] = obj;
					html += "<div class=\"block\" id=\"score_"+obj.key+"\">";
					if(obj.name==PARAMS.user) {
						html += "<div style=\"font-size:16px;\">";
						html += "<strong style=\"width:160px; color:red; float:left;\">"+(i+1)+"、"+obj.name+"</strong>";
						html += "<span style=\"color:red;\">积分：<strong>"+obj.score+"</strong></span>";
						html += "</div>";
					} else {
						html += "<div>";
						html += "<strong style=\"width:160px; float:left;\">"+(i+1)+"、"+obj.name+"</strong>";
						html += "<span>积分：<strong>"+obj.score+"</strong></span>";
						html += "</div>";
					}
					html += "</div>";
				}
				$("#score_list").append(html);
			}
		});
	};
	
</script>
</head>
<body style="margin:auto; padding:30px; font-size:12px">
	<div id="score_list" class="matchList">
		<!-- <div class="block" id="match_d8310b0305bd4fec875e40a5f23ea153">
			<div class="title">
				<span style="float:right; line-height: 24px; margin-right: -2px;">
					<span class="sureBtn" onclick="javascript:selWinner('d8310b0305bd4fec875e40a5f23ea153');">下注</span>
				</span><strong style="font-size:20px">希腊VS捷克</strong>
				<span style="margin-left:20px">开始时间：<strong>2012-06-13 00:00:00</strong></span>
			</div>
			<div class="overview">
				<span>甲方：<strong>希腊</strong>(<a style="color:#DC143C; font-weight:bold; padding:0 2px;">10</a>)</span>
				<span>乙方：<strong>捷克</strong>(<a id="btn_demo_stake" style="color:#DC143C; font-weight:bold; padding:0 2px;">8</a>)</span>
				<span>平局：<strong>平局</strong>(<a style="color:#DC143C; font-weight:bold; padding:0 2px;">8</a>)</span>
				<span>赢方：<strong style="color: red;">暂无</strong><strong style="margin-left:5px;">(1:1)</strong></span>
				<div>
					赛事简介：	
					<pre style="color:#6495ED;">2012欧洲杯A组第二轮希腊与捷克的比赛，赛前双方公布了各自的首发阵容，
首轮比赛帮助希腊追平波兰的超级替补萨尔平吉迪斯首发，而捷克阵中，首轮表现不佳的巴罗什继续出现在锋线上。</pre>
				</div>	
			</div>
		</div> -->
	</div>
	
</body>
</html>